//
//  MeTableViewCellOfSelectArea.m
//  LOLer
//
//  Created by kaijie on 16/4/1.
//  Copyright © 2016年 kaijie. All rights reserved.
//

#import "MeTableViewCellOfSelectArea.h"

@implementation MeTableViewCellOfSelectArea
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    return self;
}
-(void)setupViews{
    [self.contentView addSubview:self.imageViewOfX];
    [self.contentView addSubview:self.imageViewOfmarker];
    [self.contentView addSubview:self.buttonOfSelect];
    [self.contentView addSubview:self.buttonOfShare];
    

}
-(void)addViewsConstraints{
    [_buttonOfSelect mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView.mas_centerX);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.height.mas_equalTo(17);
        make.width.mas_equalTo(108);
        
    }];
    [_imageViewOfX mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.leading.equalTo(_buttonOfSelect);
        make.width.height.mas_equalTo(17);
    }];
    [_imageViewOfmarker mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.equalTo(_buttonOfSelect);
        make.top.equalTo(_buttonOfSelect.mas_top).offset(2);
        make.bottom.equalTo(_buttonOfSelect.mas_bottom).offset(-2);
        make.width.height.mas_equalTo(13);
    }];
    [_buttonOfShare mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(_buttonOfSelect.mas_centerY);
        make.top.equalTo(self.contentView.mas_top).offset(10);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-14);
        make.trailing.equalTo(self.contentView.mas_trailing).offset(-15);
        make.width.mas_equalTo(14);
    }];
    
}
-(void)setData:(NSDictionary *)data{
    
}
-(UIImageView *)imageViewOfmarker{
    if (!_imageViewOfmarker) {
        _imageViewOfmarker=[UIImageView new];
        _imageViewOfmarker.image=[UIImage imageNamed:@"friend_header_down"];
    }return _imageViewOfmarker;
    
}
-(UIImageView *)imageViewOfX{
    if (!_imageViewOfX) {
        _imageViewOfX=[UIImageView new];
        _imageViewOfX.image=[UIImage imageNamed:@"talent_simulator_offense_mark_view"];
    }return _imageViewOfX;
}
-(UIButton *)buttonOfSelect{
    if (!_buttonOfSelect) {
        _buttonOfSelect=[UIButton new];
        _buttonOfSelect.tag=101;
           [_buttonOfSelect setTitle:@"艾欧里亚" forState:UIControlStateNormal];;
       _buttonOfSelect.titleLabel.font = [UIFont systemFontOfSize:16];
        _buttonOfSelect.titleLabel.textAlignment = NSTextAlignmentCenter;//设置title的字体居中
        [_buttonOfSelect setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [_buttonOfSelect addTarget:self action:@selector(PopUpselectorButton:) forControlEvents:UIControlEventAllTouchEvents];
       
        
        
    }return _buttonOfSelect;
}
-(UIButton *)buttonOfShare{
    if (!_buttonOfShare) {
        _buttonOfShare=[UIButton new];
        [_buttonOfShare setBackgroundImage:[UIImage imageNamed:@"share_normal"] forState:UIControlStateNormal];
        _buttonOfShare.tag=102;
        [_buttonOfShare addTarget:self action:@selector(PopUpselectorButton:) forControlEvents:UIControlEventAllTouchEvents];
    }return _buttonOfShare;
}
-(void)PopUpselectorButton:(UIButton*)button{
    if (button.tag==101) {
    NSLog(@"asd");
    }else{
        NSLog(@"dfg");
    }
}

@end
